UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OU69Ox+4LP+mejYh5UPNbtBc7Beeyq/BaF9QhtNNSZk=' 
WHERE 
  key_id = 'd86a7f4946a7bc4e1cb575dc3844f380aa4acbea9637a08aaf304e892b23137c' 
  AND (
    token = 'OU69Ox+4LP+mejYh5UPNbtBc7Beeyq/BaF9QhtNNSZk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042