UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MuYdqsCYD4cAiEUrUoxKVb+oEZjoaZOFUZ+GvNszfv4=' 
WHERE 
  key_id = 'ebf67926fa468d7a61295e4ed642fadb95fda2dc5b2ed02e6c2cb677fc5d548c' 
  AND (
    token = 'MuYdqsCYD4cAiEUrUoxKVb+oEZjoaZOFUZ+GvNszfv4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051