UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9b/KLzrKCfmmAoFbzFFMwYEE/VfkFrmo0LXq/EPqZhw=' 
WHERE 
  key_id = '86c6b67ce1bc4a975b28360f2d8d48ca14e48003d301b5c8fa9f37b85fd5520d' 
  AND (
    token = '9b/KLzrKCfmmAoFbzFFMwYEE/VfkFrmo0LXq/EPqZhw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061