UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l5msGMTTxwN7s+FI1Tyjf8QrcomY1Gzjk7+shndLaB4=' 
WHERE 
  key_id = '372e41a8fc98d99f405ec88a46a2dafd9b0cda162be4ccabf25c24f0dcee1cea' 
  AND (
    token = 'l5msGMTTxwN7s+FI1Tyjf8QrcomY1Gzjk7+shndLaB4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024