UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rqmBfuONJtnLXqvZ8I+N6JMsjALupe/3VUCZxEBdeiE=' 
WHERE 
  key_id = '849200f9770a1590f60eb9c47be6eaac60b8159fb52226ca9334042dcd880d1e' 
  AND (
    token = 'rqmBfuONJtnLXqvZ8I+N6JMsjALupe/3VUCZxEBdeiE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034