UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ukTX6uLvROnzcIblUFdAgtgWgvzUcVfpTDh8XPGcy9E=' 
WHERE 
  key_id = '0d2128091116b52f6835e6c353f751d24987b12187738e46720451384217cb3a' 
  AND (
    token = 'ukTX6uLvROnzcIblUFdAgtgWgvzUcVfpTDh8XPGcy9E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028