UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'StoEsst4V/AMXLym1c2DITZkTljfspE8W0r1wiPMGgs=' 
WHERE 
  key_id = '06cabc2a5d55d22c517fe79aed8707875f0f8a9e0ec1cdb87443cdb79effaa2b' 
  AND (
    token = 'StoEsst4V/AMXLym1c2DITZkTljfspE8W0r1wiPMGgs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035