UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wWOo8tsrUMRrrKZMmbfBbiGe+0JqC+u+/LtOioxk2X4=' 
WHERE 
  key_id = '5a4c59eef12c89c6d9227f78cf016c9c1ce7fb564c8d48d9c205cefa7a319650' 
  AND (
    token = 'wWOo8tsrUMRrrKZMmbfBbiGe+0JqC+u+/LtOioxk2X4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055