UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HNu6dR2nkx8C4Gk6Aakoxrq/NV2m9W9B14LWGMYkvNw=' 
WHERE 
  key_id = 'db8b535b4db7dfac9d3faa6843fa375de4a639ff97509b57aef2d1a9f75daf82' 
  AND (
    token = 'HNu6dR2nkx8C4Gk6Aakoxrq/NV2m9W9B14LWGMYkvNw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031