UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jb0sEHBXOYxTm6yQLzKBStGLWXFlLdgwp2Ml6Iz4qWE=' 
WHERE 
  key_id = 'be998ff79a64a6e3d12bce47d170e6bb84de98b7697f83fd45c8e9130bd9f985' 
  AND (
    token = 'jb0sEHBXOYxTm6yQLzKBStGLWXFlLdgwp2Ml6Iz4qWE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042