UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GXOSbGT2KrFN4qP+4YVMR/+JYTUgVtm9azhvkXLo5cE=' 
WHERE 
  key_id = 'd9f365f5883197728bad4ac0039274bedf41142924b56a430dc1ee9dca34a8bc' 
  AND (
    token = 'GXOSbGT2KrFN4qP+4YVMR/+JYTUgVtm9azhvkXLo5cE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038