UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'deLsZJGq2F6D/MUIuyEVaCNpEye5vRqZiJrCuuPBqhY=' 
WHERE 
  key_id = '44b3935f73d6d12d5fc13f6c029e84f4c3116871effb7062763f737be4fef20a' 
  AND (
    token = 'deLsZJGq2F6D/MUIuyEVaCNpEye5vRqZiJrCuuPBqhY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023