UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'itSDNnnNcuMxqzjrBra/Ik0UKetvZQP/ZAhfkmyNpxQ=' 
WHERE 
  key_id = 'b28851fa36e26cf5b3459d7e5358cb38757de3cd4bfd7b283c652293a8b99acb' 
  AND (
    token = 'itSDNnnNcuMxqzjrBra/Ik0UKetvZQP/ZAhfkmyNpxQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020