UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oWD1H97NucxuIoas2ERX1jUAIsqNaiN+FGUgVHCJwCw=' 
WHERE 
  key_id = 'ff53da808a914f8d4035ae7a5f0881fe07d992534d3b3ac8096359dd1dc8fa7c' 
  AND (
    token = 'oWD1H97NucxuIoas2ERX1jUAIsqNaiN+FGUgVHCJwCw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015