UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5wU5k7gbE/rHo++hxbqGkiEAgiUNNh4xast3G8BF7gw=' 
WHERE 
  key_id = '113bbec8e939519d58adf5a607975b05d8ce94f5d9c503397bd54b08cd98efbc' 
  AND (
    token = '5wU5k7gbE/rHo++hxbqGkiEAgiUNNh4xast3G8BF7gw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017