UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KMQY0cCZ6m47j7uLxMddbbxDbbuMcLw/OPjLCs6fSmc=' 
WHERE 
  key_id = '091c0eb5bd82668831670d0388c7da0b06051d1d9cdb18ed089702b728382a36' 
  AND (
    token = 'KMQY0cCZ6m47j7uLxMddbbxDbbuMcLw/OPjLCs6fSmc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026