UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oJE83U+KmX6l8mCD+VRxotszZR/Xk+Id7tWRulkqzCk=' 
WHERE 
  key_id = '8d25ec2e798aac93d0ce07310ea628babd9a39a5990abb8625b7b581eff439b6' 
  AND (
    token = 'oJE83U+KmX6l8mCD+VRxotszZR/Xk+Id7tWRulkqzCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024