UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ibdRX/gvlCES5PnurPnRT3dfoWX9e4i5ci5DLgxo09E=' 
WHERE 
  key_id = '9ab6d971d4653e1906ae744b44e2504289760b789b5fc365e0577975eab99e92' 
  AND (
    token = 'ibdRX/gvlCES5PnurPnRT3dfoWX9e4i5ci5DLgxo09E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058