UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm8RJw+7SBvl6WiInxVhjprecaFA4MwVdH6q9MoQUT1s=' 
WHERE 
  key_id = '936fbc2ed959a3bb342472b89306bf102437c40aaf331648354e4c756207ad35' 
  AND (
    token = 'm8RJw+7SBvl6WiInxVhjprecaFA4MwVdH6q9MoQUT1s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047