UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eXGHDTaKsnXedJhcfExhmi8Rm8I/Sw6VCIEvyNngzoc=' 
WHERE 
  key_id = 'd08d5f82156d76dbcc56988dd47b774fcb3d166c8a510bb89b35529d46e1bbe6' 
  AND (
    token = 'eXGHDTaKsnXedJhcfExhmi8Rm8I/Sw6VCIEvyNngzoc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00615