UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LOc7S1CyzuF6CxtMQD4sk0RBm+66YgRhuhL4hKCYXGM=' 
WHERE 
  key_id = '0da5e15c459c4397ba39ef5af5c911f64ed2c3a0aa03da887e4a33dbf5cd4636' 
  AND (
    token = 'LOc7S1CyzuF6CxtMQD4sk0RBm+66YgRhuhL4hKCYXGM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026