UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5RSE2T0v0fZxKMzc7stlgct2wfT76zX7uPp8wG69iwQ=' 
WHERE 
  key_id = '7d4c7d49f44b37d160cebc342b06605ead2521449a39fb9b48eb4df5cf4ee97c' 
  AND (
    token = '5RSE2T0v0fZxKMzc7stlgct2wfT76zX7uPp8wG69iwQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031