UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '77QEeQJxGjPq8G33I1BRlPAG22KkMt/Wu3P4c3hM8JQ=' 
WHERE 
  key_id = '3c07a8d2a65ed507081c2e3ec5ac4c01c6d30d7144ce08f2e6e65fb596eb2b95' 
  AND (
    token = '77QEeQJxGjPq8G33I1BRlPAG22KkMt/Wu3P4c3hM8JQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056