UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'la00ZLESaweFowfkyDjPImw0PyDgL0Xx/pvj2hO0s0c=' 
WHERE 
  key_id = 'b5a11545303f8bdda49e020fed29073a3c8e8fec63d7a43d9bfd1d3fd3dc56fc' 
  AND (
    token = 'la00ZLESaweFowfkyDjPImw0PyDgL0Xx/pvj2hO0s0c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00065