UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gvl2VWjvPAgEuwulMfURjDtQmk4ae7yawZL/dgh9FgA=' 
WHERE 
  key_id = '7487465f2a1f64c7d3a853d3d3fe38b74b9ed13c8cf5cd8f5aa2d4472a84de29' 
  AND (
    token = 'gvl2VWjvPAgEuwulMfURjDtQmk4ae7yawZL/dgh9FgA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036