UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rxmTYcVMEdX9dm1WCIZl2yalH0xwgzhLbmOWdKhPYYI=' 
WHERE 
  key_id = 'e36956b22c8782f3bb47016d40c9163f8ae3e2b406e0f59646ee641ec6d3651b' 
  AND (
    token = 'rxmTYcVMEdX9dm1WCIZl2yalH0xwgzhLbmOWdKhPYYI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041