UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ioulQe0IvPFgbFOIsNUh4esiy8y4+DwSbxfDHc900Vo=' 
WHERE 
  key_id = 'cf3742f8d4d5153c597edbc0b95bae5c0da82277b79e6e006cd428838c10522a' 
  AND (
    token = 'ioulQe0IvPFgbFOIsNUh4esiy8y4+DwSbxfDHc900Vo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029