UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XiK6sY/s4EWoxXp9LCXO8rBx4mTSy0ZDgj1lrG8OrwY=' 
WHERE 
  key_id = '93310413ca43c9bb9aed45e2f42bdc2108f9887d8f93590dfe6c48739a4a7912' 
  AND (
    token = 'XiK6sY/s4EWoxXp9LCXO8rBx4mTSy0ZDgj1lrG8OrwY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036