UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qTT0hKgVUD6cT1nWK4CcANkcCdoXK9Cv75CxSGXlQck=' 
WHERE 
  key_id = '2f4bd57f8f71788b99ca4edb80b1f9da36cc2412f2d0f9eef728f3f017bcc5fc' 
  AND (
    token = 'qTT0hKgVUD6cT1nWK4CcANkcCdoXK9Cv75CxSGXlQck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050