UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PZ3mF+J04haLxpJEA50+KOtaIiJBt95gLRf+7/Bk4vQ=' 
WHERE 
  key_id = '61c4c7e3fbb267832d1802fd6e3bc9f7dad0b4476609c933b50b69f6ed03f837' 
  AND (
    token = 'PZ3mF+J04haLxpJEA50+KOtaIiJBt95gLRf+7/Bk4vQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018