UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9MnFEGJzFd/GWNCuXbAOVTGW3r60oVztLEoR3FRCETM=' 
WHERE 
  key_id = '4732ab75e0820ee7f27aa9d0ef374c6982e6a6689072b030925d60d5e0c09a4d' 
  AND (
    token = '9MnFEGJzFd/GWNCuXbAOVTGW3r60oVztLEoR3FRCETM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026