UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qdu2Im5NT/rY8VUGvRV5dcQX02aW2sTYgbGhT0sbMgU=' 
WHERE 
  key_id = 'bbcd0f5ddb55d63751385ff90c834e8446cbe32bcc4f1f1404e0f43cb2aa5977' 
  AND (
    token = 'Qdu2Im5NT/rY8VUGvRV5dcQX02aW2sTYgbGhT0sbMgU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031