UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wTZNGEm+gDJ4W9/U/dlQfpZZrfySgRT0zU2XmAhlv7o=' 
WHERE 
  key_id = '8d8bada10b82d9b4a97bb2c3b53290838e1982e049e6020dc00c0b258a7109e6' 
  AND (
    token = 'wTZNGEm+gDJ4W9/U/dlQfpZZrfySgRT0zU2XmAhlv7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036