UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tMovbjX8TFbJMPADXYdStfa1ua6NacTiW5NBchBS/oc=' 
WHERE 
  key_id = 'eecd42dd209e640f99285e655b2e04016e9d1c1e6704b09c29bd62e46ea9ec4a' 
  AND (
    token = 'tMovbjX8TFbJMPADXYdStfa1ua6NacTiW5NBchBS/oc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023