UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kwwvvNzFah6JmlZJrmzldGQAgJxDNSnKyoItJgjOuxg=' 
WHERE 
  key_id = 'bfc13decc5cfa4307bb108011f4d1e20ed4dbe8d6b6991fe68e700dcf16dfeb7' 
  AND (
    token = 'kwwvvNzFah6JmlZJrmzldGQAgJxDNSnKyoItJgjOuxg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037