UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KWDHTrr4+PqXk/n2fE+q1kQCk3VzXVc6AF9+SJqvUkw=' 
WHERE 
  key_id = '53add0e1d626ad5b5fc246218114875cafcce8a3ca99616b92c613a5590f95bb' 
  AND (
    token = 'KWDHTrr4+PqXk/n2fE+q1kQCk3VzXVc6AF9+SJqvUkw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029